﻿<script src="~/Scripts/project/operationmanagestaff.js"></script>
@using Webdiyer.WebControls.Mvc;
@using MinistryStandardPlatformWeb
@model PagedList<MinistryStandardPlatformEntity.InfoStaff>

<div class="menu " id="subMenu">
    @using (Ajax.BeginForm("Data",
        new RouteValueDictionary { { "pageIndex", "" } },
        new AjaxOptions
        {
            UpdateTargetId = "tablelist",
            InsertionMode = InsertionMode.InsertAfter,
            OnFailure = "loadFailed",
            LoadingElementId = "waitingPic",
            OnComplete = "loadComplete"
        },
        new RouteValueDictionary { { "id", "searchForm" } }))
    {
        if (CommonFunctions.GetLoginUser().HasMenuRight("154"))
        {
        <span>
            <input type="button" id="refreshBtn" value="刷新" /></span>
        }
        if (CommonFunctions.GetLoginUser().HasMenuRight("151"))
        {
        <span>
            <input type="button" id="createBtn" value="新增" data-href="/Staff/Create" data-text="新增人员" /></span>
        }
        if (CommonFunctions.GetLoginUser().HasMenuRight("153"))
        {
        <span>
            <input type="button" id="editBtn" value="修改" data-href="/Staff/Edit" data-text="修改人员信息" /></span>
        }
        if (CommonFunctions.GetLoginUser().HasMenuRight("152"))
        {
        <span>
            <input type="button" id="deleteBtn" value="删除" /></span>
        }
        if (CommonFunctions.GetLoginUser().HasMenuRight("154"))
        {    <span style="margin-left: 50px;">
        <input type="text" id="condition" name="condition" placeholder="请输入人员姓名" style="width: 200px;" /></span>
        <span style="margin-left: 15px;">
            <input type="checkbox" id="searchAll" name="searchAll" style="vertical-align: middle;" />
            <label for="searchAll">包含下级</label>
        </span>
        <input type="hidden" id="unitId" name="unitId" />
        <span style="margin-left: 15px;">
            <input type="button" id="searchBtn" value="搜索" />
        </span>
        }
    }
</div>
<div class="fillparentheight" id="tablelist" style="overflow: auto;">
    <div id='waitingPic' style='width: 100%; text-align: center; display: none;' class="fillparentheight">
        <img src='/Images/loading.gif' style='top: 50%; position: absolute; margin-top: -50px;' />
    </div>
    <div id='errorPic' style='width: 100%; text-align: center; display: none;' class="fillparentheight">
        <img src='/Images/loaderror.png' style='top: 50%; position: absolute; margin-top: -50px;' />
    </div>
    @Html.Partial("Data", Model)
</div>
